home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Workspace / Locus / Source / Folder.h < prev    next >
Text File  |  1995-06-12  |  3KB  |  131 lines

  1.  
  2. /*
  3.     Copyright 1993  Jeremy Slade.
  4.  
  5.     You are free to use all or any parts of the Locus project
  6.     however you wish, just give credit where credit is due.
  7.     The author (Jeremy Slade) shall not be held responsible
  8.     for any damages that result out of use or misuse of any
  9.     part of this project.
  10.  
  11. */
  12.  
  13. /*
  14.     Project: Locus
  15.     
  16.     Class: Folder
  17.     
  18.     Description:
  19.     
  20.     Folder is a subclass if List, and its function is simply to manage that groups that it contains, and to provide the means to display them.  The displaying is done through the use of the FolderViewer class, which displays the group that is currently selected in its browser.  The Folder keeps track of the size and location of the screen, and the selected group so that these attributes will be restored when the Folder is opened again.
  21.  
  22.     Original Author: Jeremy Slade
  23.     
  24.     Revision History:
  25.         Created
  26.             V.101    JGS Wed Feb  3 23:26:29 GMT-0700 1993
  27.  
  28. */
  29.  
  30.  
  31. #ifndef Folder_h
  32. #define Folder_h
  33.  
  34. #define Folder_VERSION    (101)
  35.  
  36.  
  37. #import <objc/List.h>
  38. #import <appkit/graphics.h>
  39. #import <dpsclient/dpsclient.h>
  40. #import "FolderViewer.h"
  41. #import "Group.h"
  42.  
  43.  
  44. @interface Folder : List
  45. {
  46.     id    currentGroup;
  47.     int    currentGroupTag;
  48.     char    *filename;
  49.     
  50.     id    viewer;
  51.     unsigned int viewerNum;    
  52.     NXRect    frameRect;    // Frame of the viewer
  53.     
  54.     struct _folderFlags {
  55.         unsigned    isChanged:1;
  56.         unsigned    needsLoadBrowser:1;
  57.         unsigned    needsSort:1;
  58.         unsigned    removedGroup:1;
  59.         unsigned    replaceGroups:1;
  60.         unsigned    orderedGroups:1;
  61.         unsigned    needsShow:1;
  62.         unsigned    autoDisplay:1;
  63.     } fFlags;
  64.  
  65.     id changedGroups;
  66.     
  67. }
  68.  
  69. // Creating, initializing instances
  70. + initialize;
  71. - initCount:(unsigned int)numSlots;
  72. - free;
  73.  
  74. // Filename
  75. - (const char *)filename;
  76. - setFilename:(const char *)path;
  77.  
  78. // Folder Info
  79. - readInfo;
  80. - writeInfo;
  81.  
  82. // Displaying
  83. - becomeKeyFolder;
  84. - resignKeyFolder;
  85. - setNeedsShow:(BOOL)flag;
  86. - (BOOL)needsShow;
  87. - setAutoDisplay:(BOOL)flag;
  88. - (BOOL)isAutoDisplay;
  89. - showSelf:sender;
  90. - obtainViewer:newViewer;
  91. - releaseViewer;
  92. - setViewerFrame:(const NXRect *)newFrame;
  93. - viewer;
  94. - (int)viewerNum;
  95. - updateInspector:sender;
  96.  
  97. // Change flag
  98. - groupChanged:aGroup;
  99. - groupRemoved;
  100. - groupSaved:aGroup;
  101. - (BOOL)isChanged;
  102. - (BOOL)needsLoadBrowser;
  103. - setChanged:(BOOL)flag;
  104. - setNeedsLoadBrowser:(BOOL)flag;
  105. - replaceAllGroups;
  106.  
  107. // Groups
  108. - readGroups;
  109. - writeGroups;
  110. - (int)tagFor:group;
  111. - groupWithTag:(int)tag;
  112. - groupMenu;
  113. - currentGroup;
  114. - newGroup:sender;
  115. - deleteCurrentGroup:sender;
  116. - launchCurrentGroup:sender;
  117. - cleanUpCurrentGroup:sender;
  118. - groupCalled:(const char *)groupName;
  119. - (BOOL)groupExists:(const char *)groupName;
  120. - renameGroup:aGroup to:(const char *)aString;
  121. - selectGroupFromMenu:sender;
  122. - makeCurrentGroup:sender;
  123. - sortGroups;
  124.  
  125. // Responding to key events
  126. - keyDown:(NXEvent *)event;
  127.  
  128. @end
  129.  
  130. #endif // Folder_h
  131.